package cn.edu.cqu.newslab.model;
/**
 * user 实体类
 * @author dongaotong
 */
public class User {
	
	private String firstName; //第一个名字
	private String lastName;  //最后名字
	
	/**
	 * 无参构造方法
	 */
	public User() {
		super();
	}
	/**
	 * 带有参数的构造函数
	 * @param firstName 第一个名字
	 * @param lastName 最后名字
	 */
	public User(String firstName, String lastName) {
		super();
		this.firstName = firstName;
		this.lastName = lastName;
	}
	/**
	 * getter and setter
	 * @return
	 */
	public String getFirstName() {
		return firstName;
	}
	/**
	 * getter and setter
	 * @return
	 */
	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}
	/**
	 * getter and setter
	 * @return
	 */
	public String getLastName() {
		return lastName;
	}
	/**
	 * getter and setter
	 * @return
	 */
	public void setLastName(String lastName) {
		this.lastName = lastName;
	}
	
	public void init() {
		if("".equals(this.getFirstName())||null == this.getFirstName()){
			 throw new IllegalArgumentException(" you must set the [firstName] property, bean of type[user]");
		}else{
			System.out.println(this.getFirstName()+" "+this.getLastName()+" User init...");
		}
	}

	public void destory() {
		if("".equals(this.getFirstName())){
			System.out.println(" User's firstName or lastName is empty, destory fault!");
		}else{
			System.out.println(this.getFirstName()+" "+this.getLastName()+" User destory...");
		}
	}
}
